package com.dragon.repository.domain.vo;

import com.dragon.common.model.Update;
import com.dragon.repository.entity.ContractFit;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import com.dragon.common.util.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
import java.util.Date;


/**
 * @author sy
 */
@Data
@ApiModel(value = "")
public class ContractFitVO {

    private static final long serialVersionUID = 1L;

    private Integer id;

    @ApiModelProperty(value = "乙方名称")
    private String partyBName;

    @ApiModelProperty(value = "默认送货负责人")
    private Integer deliverAdminId;

    @ApiModelProperty(value = "默认生产负责人")
    private Integer produceAdminId;

    @ApiModelProperty(value = "默认收款人")
    private Integer payeeAdminId;

    @ApiModelProperty(value = "乙方首字母")
    private String codeLetter;

    @ApiModelProperty(value = "电话")
    private String telephone;

    @ApiModelProperty(value = "联系人")
    private String firstcontacter;

    @ApiModelProperty(value = "传真")
    private String fax;

    @ApiModelProperty(value = "地址")
    private String address;

    @ApiModelProperty(value = "签订地点")
    private String signedAddress;

    @ApiModelProperty(value = "开户行")
    private String bankAddress;

    @ApiModelProperty(value = "银行卡账号")
    private String bankNum;

    @ApiModelProperty(value = "法定代表人名称")
    private String legalRepresentName;


    @NotNull(groups = Update.class,message = "主键不能为空")
    public static ContractFit convert(ContractFitVO vo) {
        ContractFit entity = new ContractFit();
        BeanUtils.copyProperties(vo,entity);
        return entity;
    }
    public static List<ContractFit> convertList(List<ContractFitVO> list) {
        List<ContractFit> resultList = new ArrayList<>();
        for (ContractFitVO vo : list) {
            resultList.add(convert(vo));
        }
        return resultList;
    }
}
